package com.ccp.dev.core.basic.bpm.util;


import com.ccp.dev.core.util.AppUtil;
import org.flowable.common.engine.impl.interceptor.CommandExecutor;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.impl.ProcessEngineImpl;


/**
 * 获取命令执行器。
 *
 * @author ray
 */
public class FlowableUtil {

    /**
     * 获取流程引擎命令执行对象，用于执行CMD对象。
     *
     * @return CommandExecutor1
     */
    public static CommandExecutor getCommandExecutor() {
        ProcessEngineImpl engine = (ProcessEngineImpl) AppUtil.getBean(ProcessEngine.class);
        CommandExecutor cmdExecutor = engine.getProcessEngineConfiguration().getCommandExecutor();
        return cmdExecutor;
    }
}
